<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Pay a Bill</title>
    </h:head>
    <h:body>
        <h1>Pay a Bill</h1>
        <br />
        <br />
        <a href="mainMenu.xhtml">Main Menu</a>
        <br />
        <br />
        <h:form>
            <h:panelGrid>
                <h:outputText value="From Account: " />
                <h:selectOneMenu value="#{customerManagedBean.transactionAccount}" required="true" requiredMessage="Please enter an origin account">
                    <f:selectItems value="#{customerManagedBean.accounts}" var="transactionAccount" itemLabel="${transactionAccount.accountId}" itemValue="${transactionAccount}" />
                    <f:converter converterId="accountConverter" />
                </h:selectOneMenu>
                <h:outputText value="Billers ID " />
                <h:inputText id="billerID" size="50" required="true" requiredMessage="Please enter the billers ID" value="#{customerManagedBean.payBillerID}" />
                
                <h:outputText value="Amount: " />
                <h:inputText id="amount" size="50" required="true" requiredMessage="Please enter the transaction Amount" value="#{customerManagedBean.transactionAmount}" />
                
                <h:outputText value="Description: " />
                <h:inputText id="description" size="50" required="true" requiredMessage="Please enter a decription" value="#{customerManagedBean.transactionDescription}" />
                
            </h:panelGrid>
            
            <h:commandButton id="submit" value="Pay Bill" action="#{customerManagedBean.payBill}" />
        </h:form>
    </h:body>
</html>

